/*
 Navicat Premium Data Transfer

 Source Server         : sawdqwdq
 Source Server Type    : MySQL
 Source Server Version : 50713
 Source Host           : localhost:3306
 Source Schema         : Mybatisdb

 Target Server Type    : MySQL
 Target Server Version : 50713
 File Encoding         : 65001

 Date: 05/11/2020 13:59:00
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of course
-- ----------------------------
BEGIN;
INSERT INTO `course` VALUES (101, '数学');
INSERT INTO `course` VALUES (102, '英语');
INSERT INTO `course` VALUES (103, '语文');
COMMIT;

-- ----------------------------
-- Table structure for dept
-- ----------------------------
DROP TABLE IF EXISTS `dept`;
CREATE TABLE `dept` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of dept
-- ----------------------------
BEGIN;
INSERT INTO `dept` VALUES (1, 'java研发部');
INSERT INTO `dept` VALUES (2, '算法部');
COMMIT;

-- ----------------------------
-- Table structure for emp
-- ----------------------------
DROP TABLE IF EXISTS `emp`;
CREATE TABLE `emp` (
  `emp_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `age` int(11) DEFAULT NULL,
  `sex` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `salary` int(10) DEFAULT NULL,
  `d_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`emp_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of emp
-- ----------------------------
BEGIN;
INSERT INTO `emp` VALUES (1, '王诗赞', 18, '男', 30000, 1);
INSERT INTO `emp` VALUES (2, '王嚎嚎', 18, '男', 1000000, 1);
INSERT INTO `emp` VALUES (3, '长立', 18, '男', 10000000, 2);
INSERT INTO `emp` VALUES (5, '田鹏杰', 18, '女', 1000, 1);
COMMIT;

-- ----------------------------
-- Table structure for passenger
-- ----------------------------
DROP TABLE IF EXISTS `passenger`;
CREATE TABLE `passenger` (
  `p_id` int(11) DEFAULT NULL,
  `p_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `p_age` varchar(255) COLLATE utf8_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of passenger
-- ----------------------------
BEGIN;
INSERT INTO `passenger` VALUES (1, '赵四', '18');
INSERT INTO `passenger` VALUES (2, '老王', '16');
COMMIT;

-- ----------------------------
-- Table structure for passport
-- ----------------------------
DROP TABLE IF EXISTS `passport`;
CREATE TABLE `passport` (
  `id` int(11) DEFAULT NULL,
  `nationality` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `expire` date DEFAULT NULL,
  `p_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of passport
-- ----------------------------
BEGIN;
INSERT INTO `passport` VALUES (1, 'china', '2020-09-24', 1);
INSERT INTO `passport` VALUES (2, 'USA', '2020-09-24', 2);
COMMIT;

-- ----------------------------
-- Table structure for sc
-- ----------------------------
DROP TABLE IF EXISTS `sc`;
CREATE TABLE `sc` (
  `course_id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  PRIMARY KEY (`course_id`,`student_id`),
  KEY `fk_student_id` (`student_id`),
  CONSTRAINT `fk_course_id` FOREIGN KEY (`course_id`) REFERENCES `course` (`id`),
  CONSTRAINT `fk_student_id` FOREIGN KEY (`student_id`) REFERENCES `student` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sc
-- ----------------------------
BEGIN;
INSERT INTO `sc` VALUES (101, 1);
INSERT INTO `sc` VALUES (102, 1);
INSERT INTO `sc` VALUES (102, 2);
INSERT INTO `sc` VALUES (103, 2);
INSERT INTO `sc` VALUES (102, 3);
COMMIT;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `id` int(11) NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  `sex` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of student
-- ----------------------------
BEGIN;
INSERT INTO `student` VALUES (1, 'jack', '女');
INSERT INTO `student` VALUES (2, 'rose', '女');
INSERT INTO `student` VALUES (3, 'tom', '女');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
